<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Login Page</title>
		<script language="javascript" src="Js/jquery-1.6.1.js" type="text/javascript"></script>
		<script type="text/javascript">	
		
		Validate = function()
		{
			var login = $('#login').val();
			//alert(login);
			var password = $('#password').val();
			//alert(password);
			
			if(login == "") $("#lblLogin").text('*');			
			if(password == "") $("#lblPassword").text('*');
			
			if(login != "" && password != "")
			{
				document.login.submit();
				//e.preventDefault();
			}
		};
		
		</script>

	</head>
<body>

	<FORM method="POST" action="login" name="login">
	<TABLE style="Width:500px;">
		<TR>
			<TD>login : </TD>
			<TD><INPUT id="login" TYPE='text' NAME='login' size='30'/></TD>
			<TD><span>default : sami</span></TD>
			<TD><span id="lblLogin" style="color:red;"></span></TD>
		</TR>
		<TR>
			<TD>Mot de passe : </TD>
			<TD><INPUT id="password" TYPE='password' NAME='password' size='30'/></TD>
			<TD><span>default : sami</span></TD>
			<TD><span id="lblPassword" style="color:red;"></span></TD>
		</TR>
		<TR>
			<TD>
				<% 
					Object loginWithSuccess = request.getAttribute("loginWithSuccess");
					
					if(loginWithSuccess != null){
						
						if(loginWithSuccess.equals(false))
						{
							out.print("Login Failed.");
						}
					}
				%>
			</TD>
		</TR>
		<TR>
			<TD>&nbsp;</TD>
			<TD style='text-align :right'>
			<INPUT TYPE="button" value="Valider"  onClick="Validate()">
		</TD>
		</TR>
	</TABLE>
	</FORM>

</body>
</html>